public class Main {
    public static void main(String[] args) {
        //去掉字符串两边空格
        String str="  a  bcr  ry  ";
        String ret=str.trim();
        System.out.println(str);
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        //截取字符串
        String str="abcvds";
        String ret=str.substring(2);
        System.out.println(ret);
        //[2,4)
        String ret1=str.substring(2,4);
        System.out.println(ret1);
    }
}